Computes the sample covariance of two data sets.
The covariance computed is the sample covariance such that .
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in), | dimension(:) | :: | x |
The first N-element data set. |
|
| real(kind=real64), | intent(in), | dimension(size(x)) | :: | y |
The second N-element data set. |
Sample covariance; fewer than two observations or nonfinite inputs give NaN. An unrepresentable result gives signed infinity.
Computes sample covariance using independent copies of two columns. Unequal counts cause ERROR STOP with FS_ARRAY_SIZE_ERROR.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(data_column), | intent(in) | :: | x |
Paired observation columns, unchanged; unallocated storage is empty. |
||
| class(data_column), | intent(in) | :: | y |
Paired observation columns, unchanged; unallocated storage is empty. |
Sample covariance; fewer than two pairs or nonfinite values give NaN. Unrepresentable results give signed infinity.
Computes sample covariance between a column and an array, copying the column. Unequal counts cause ERROR STOP with FS_ARRAY_SIZE_ERROR.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(data_column), | intent(in) | :: | x |
The first observation column, unchanged; unallocated storage is empty. |
||
| real(kind=real64), | intent(in), | dimension(:) | :: | y |
The paired observations; must have x's count. |
Sample covariance; undersized/nonfinite data give NaN; unrepresentable results give signed infinity.
Computes sample covariance between an array and a column, copying the column. Unequal counts cause ERROR STOP with FS_ARRAY_SIZE_ERROR.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in), | dimension(:) | :: | x |
The first observation array. |
|
| class(data_column), | intent(in) | :: | y |
The paired observation column, unchanged; must have size(x) values. Unallocated storage is treated as empty. |
Sample covariance; undersized/nonfinite data give NaN; unrepresentable results give signed infinity.
Computes the mean of a set of data.
Computes the mean using a scaled, compensated sum.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | x(:) |
The array of values to analyze. |
Mean; empty arrays or nonfinite observations give NaN.
Computes a column mean using a scaled, compensated sum without copying data.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(data_column), | intent(in) | :: | x |
The input column; unallocated storage is treated as empty. |
Mean; empty arrays or nonfinite observations give NaN.
Computes the median of the values in an array.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | x(:) |
The array of values to analyze. |
Median; empty arrays or nonfinite observations give NaN.
Computes the median by sorting a copy, leaving the column unchanged.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(data_column), | intent(in) | :: | x |
The input column; unallocated storage is treated as empty. |
Median; empty or nonfinite data give NaN.
Computes the pooled estimate of variance.
Computes the pooled estimate of variance.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in), | dimension(:) | :: | si |
An N-element array containing the estimates for each of the N variances. |
|
| integer(kind=int32), | intent(in), | dimension(size(si)) | :: | ni |
An N-element array containing the number of data points in each of the data sets used to compute the variances in si. |
Pooled variance; empty inputs, nonfinite/negative variances, or groups with fewer than two observations give NaN.
Computes the pooled estimate of variance.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(array_container), | intent(in), | dimension(:) | :: | x |
An array of arrays of data. |
Pooled variance; empty/unallocated groups or groups with fewer than two finite observations give NaN.
Pools variance estimates using the array implementation on a column copy. Unequal counts cause ERROR STOP with FS_ARRAY_SIZE_ERROR.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(data_column), | intent(in) | :: | si |
Group variance estimates, unchanged; unallocated storage is empty. |
||
| integer(kind=int32), | intent(in), | dimension(:) | :: | ni |
Group observation counts; must have si's count and each be at least two. |
Pooled variance; empty data, negative/nonfinite estimates, or invalid group sizes give NaN.
Pools sample variances from an array of columns, copying each group's data.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(data_column), | intent(in), | dimension(:) | :: | x |
Observation columns; groups may have different row counts. |
Pooled variance; no groups, undersized/unallocated groups, or nonfinite observations give NaN, as in the array-container overload.
Computes the specified quantile of a data set using the SAS Method 4.
See Also
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | x(:) |
An N-element array containing the data. |
||
| real(kind=real64), | intent(in) | :: | q |
The quantile to compute (e.g. 0.25 computes the 25% quantile). |
Quantile; empty/nonfinite data or q outside [0, 1] give NaN.
Computes a quantile using the array implementation on a copy.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(data_column), | intent(in) | :: | x |
The input column, unchanged; unallocated storage is treated as empty. |
||
| real(kind=real64), | intent(in) | :: | q |
The quantile probability in [0, 1], using the array routine's interpolation. |
Quantile; empty/nonfinite data or invalid/nonfinite q give NaN.
Computes the sample standard deviation of the values in an array.
The value computed is the sample standard deviation.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | x(:) |
The array of values to analyze. |
Sample standard deviation; invalid/undersized data give NaN. It can remain finite even when the variance would overflow.
Computes sample standard deviation using the array implementation on a copy.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(data_column), | intent(in) | :: | x |
The input column, unchanged; unallocated storage is treated as empty. |
Sample standard deviation; fewer than two values or nonfinite data give NaN. Unrepresentable results give positive infinity.
Computes the trimmed mean of a data set.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(inout), | dimension(:) | :: | x |
An N-element array containing the data. On output, the array is sorted into ascending order. |
|
| real(kind=real64), | intent(in), | optional | :: | p |
An optional parameter specifying the percentage of values from either end of the distribution to remove. The default is 0.05 such that the bottom 5% and top 5% are removed. |
Trimmed mean; invalid p or empty/nonfinite data give NaN.
Computes the trimmed mean and sorts the column's values in ascending order. Uses a borrowed view without reallocating the underlying array.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(data_column), | intent(inout), | target | :: | x |
The input column; sorted on success, unchanged for invalid inputs. Unallocated storage is treated as empty. |
|
| real(kind=real64), | intent(in), | optional | :: | p |
Fraction to remove from each end, in [0, 0.5); defaults to 0.05. |
Trimmed mean; empty/nonfinite data or invalid/nonfinite p give NaN.
Computes the sample variance of the values in an array.
The variance computed is the sample variance such that .
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | x(:) |
The array of values to analyze. |
Sample variance; fewer than two observations or nonfinite inputs give NaN. An unrepresentable variance gives positive infinity.
Computes sample variance using the array implementation on a copy.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(data_column), | intent(in) | :: | x |
The input column, unchanged; unallocated storage is treated as empty. |
Sample variance; fewer than two values or nonfinite data give NaN. Unrepresentable results give positive infinity.